#include<iostream>
using namespace std;
int letra();
int main ()
{
    letra();
}
int letra()
{
    string cadena;
    char hola;
    int a;
    cin>>cadena;
    cin>>hola;
    a=0;
    while(a<cadena.length())
    {
        if(cadena[a]==hola)
        {
            cout<<a+1;
            break;
        }
        a++;
    }
        if(a==cadena.length())
        {
            a=-1;
            cout<<a;
        }
    return a;

}
